package com.zhima.controller.plain;

import com.zhima.dto.ZhimaOjResult;
import com.zhima.service.OjCodeLanguageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhima
 * @since 2023-09-05
 */
@RestController
@RequestMapping("/code-language")
public class OjCodeLanguageController {
    @Autowired
    private OjCodeLanguageService ojCodeLanguageService;

    /**
     * 返回所有支持提交的语言
     *
     * @return
     */
    @GetMapping
    public ZhimaOjResult listCodeLanguages() {
        return ZhimaOjResult.success(ojCodeLanguageService.listCodeLanguages());
    }
}
